package com.ybox.auth.form;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @Author ych
 * @create 2023-2023/2/21-15:01
 */
public class LoginByPhoneBody {

    private String phone;

    /**
     * 用户短信验证码
     */
    private String code;


    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$/",message = "手机号有误")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @NotBlank(message = "密码不能为空")
    @Length(min = 6,max = 6,message = "验证码有误")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

}
